
import java.io.File;

public class Task {
    public static void main(String[] args) {
        File file = new File("D:\\nodejs\\myblog\\blog-img\\img-master\\photos_name\\");
        File[] list = file.listFiles();
        // 如果目录下文件存在
        if (file.exists() && file.isDirectory()) {
            for (int i = 0; i < list.length; i++) {
                list[i].delete();

            }
            System.out.println("删除成功");
            }
    }
}
